//5-3constructorparam.ts准备
class ChinesePeople {
  // 准备类
  public name: string
  public sex: string
  public phone: string
  public national: string

  constructor(name: string, sex: string, phone: string, national: string) {
    this.name = name
    this.sex = sex
    this.phone = phone
    this.national = national
  }
  eat() {}
}

type Constructor<T> = new (...args: any[]) => any
// 一个类的构造函数的类型表示1
let MyChinesePeople: new (
  name: string,
  sex: string,
  phone: string,
  national: string
) => ChinesePeople = ChinesePeople

// 一个类的构造函数的类型表示2
let res= typeof ChinesePeople // new (name: string,sex: string,phone: string,national: string) => ChinesePeople
// typeof ChinesePeople 表示获取当类所处的构造函数的类型
let MyChinesePeople2: typeof ChinesePeople = ChinesePeople
let cp = new MyChinesePeople2('sef', 'sefs', '111', 's')

// new (...args: any[]) => any 所以类构造函数类型的通用写法，...args 可以表示任何参数 any可以接受任何类型
let MyChinesePeople3: new (...args: any[]) => any = ChinesePeople

export {}
